<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "logs".
 *
 * @property int $id
 * @property int $goodsid 商品
 * @property int $opid 操作人
 * @property string $oprtype 操作类型
 * @property string $remark 操作记录
 * @property string $price_remark 价格变动
 * @property string $oprtime 操作时间
 */
class Logs extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'logs';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['goodsid', 'opid'], 'integer'],
            [['opid', 'oprtype', 'oprtime'], 'required'],
            [['remark'], 'string'],
            [['oprtime'], 'safe'],
            [['oprtype'], 'string', 'max' => 10],
            [['price_remark'], 'string', 'max' => 100],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'goodsid' => '商品',
            'opid' => '操作人',
            'oprtype' => '操作类型',
            'remark' => '操作记录',
            'price_remark' => '价格变动',
            'oprtime' => '操作时间',
        ];
    }
}
